
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>秒杀列表</title>
    <%@include file="common/head.jsp"%>
    <%@include file="common/tag.jsp"%>
</head>
<body>
    <div class="container">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container-fluid">
                <div class="navbar-header">
                    <h3 id="userText"></h3>
                </div>
                <ul  class="nav navbar-nav navbar-right">

                    <li><a id="register" href="/user/register"><span class="glyphicon glyphicon-user"></span> 注册</a></li>
                    <li><a id="login" href="/user/login"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li>
                </ul>
            </div>
        </nav>
        <div class="panel panel-default text-center">
            <div class="panel panel-heading">
                <div>
                    <h2>秒杀商品列表</h2>
                </div>
            </div>
            <div class="panel-body">
                <table class="table table-hover">
                    <c:forEach var="sk" items="${list}">
                        <div class="col-sm-6 col-md-3">
                            <div class="thumbnail">
                                <img src="/img/${sk.goodsId}.png"  style="width: 180px;height:180px">
                                <div class="caption">
                                    <p>${sk.goodsName}</p><br>
                                    <p>库存:${sk.goodsNumber}</p><br>
                                    <p>开始时间:<fmt:formatDate value="${sk.startTime}" pattern="YYYY-MM-dd HH:MM:SS"/></p><br>
                                    <p>结束时间:<fmt:formatDate value="${sk.endTime}" pattern="YYYY-MM-dd HH:MM:SS"/></p><br>
                                    <p><a class="btn btn-info" href="/secKill/${sk.goodsId}/goods" target="_blank">点击查看</a></p>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </table>
            </div>
        </div>
    </div>

</body>

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<%--jquery cookie操作插件--%>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>

<script src="/resources/script/list.js" type="text/javascript"></script>

<script type="text/javascript">
    $(function () {
        $.cookie("userPhone","${userPhone}")
        list.list.init({
            username:"${userName}"
        });
    })
</script>

</html>
